package chapter_20


object Direction extends Enumeration {
  // 枚举
  val North = Value("North")
  val East = Value("East")
  val South = Value("South")
  val West = Value("West")
}


object EnumObject {

  def main(args: Array[String]): Unit = {
    for (d <- Direction.values)
      print(d + " ")
    println()

    println(Direction.East.id)
    println(Direction(1))
  }
}
